package com.tomshushu.doc.freedoc.modular.tmp.controller;

import com.tomshushu.doc.freedoc.core.model.response.ResponseData;
import com.tomshushu.doc.freedoc.core.model.response.SuccessResponseData;
import com.tomshushu.doc.freedoc.modular.tmp.entity.TmpEntity;
import com.tomshushu.doc.freedoc.modular.tmp.model.param.AddTmpParam;
import com.tomshushu.doc.freedoc.modular.tmp.model.param.DeleteTmpParam;
import com.tomshushu.doc.freedoc.modular.tmp.model.param.EditTemParam;
import com.tomshushu.doc.freedoc.modular.tmp.model.param.ListTmpParam;
import com.tomshushu.doc.freedoc.modular.tmp.service.TmpService;
import com.tomshushu.doc.freedoc.modular.user.model.param.LoginParam;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author: zhouhong
 * @date: 2025-06-10 17:26
 * @version: 1.0
 */
@RestController
@RequestMapping("/doc/tmp")
public class TmpController {

    @Resource
    private TmpService tmpService;
    @PostMapping("/addTmp")
    public ResponseData addTmp(@RequestBody AddTmpParam param) {
        tmpService.addTmp(param);
        return new SuccessResponseData();
    }

    @PostMapping("/listTmp")
    public ResponseData listTmp(@RequestBody ListTmpParam param) {
        return new SuccessResponseData(tmpService.listTmp(param));
    }

    @PostMapping("/deleteTmp")
    public ResponseData deleteTmp(@RequestBody DeleteTmpParam param) {
        tmpService.deleteTmp(param);
        return new SuccessResponseData();
    }

    @PostMapping("/editTmp")
    public ResponseData editTmp(@RequestBody EditTemParam param) {
        tmpService.editTmp(param);
        return new SuccessResponseData();
    }

}
